package edu.yzu.testspringboot002.service.impl;

import edu.yzu.testspringboot002.mapper.ChatGroupMapper;
import edu.yzu.testspringboot002.po.ChatGroup;
import edu.yzu.testspringboot002.service.ChatGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChatGroupServiceImpl implements ChatGroupService {

    @Autowired
    private ChatGroupMapper chatGroupMapper ;

    @Override
    public void addChatGroup(ChatGroup chatGroup) {
        chatGroupMapper.insertChatGroup(chatGroup);
    }

    @Override
    public void deleteChatGroupById(int id) {
        chatGroupMapper.deleteChatGroupById(id);
    }

    @Override
    public void updateChatGroup(ChatGroup chatGroup) {
        chatGroupMapper.updateChatGroup(chatGroup);
    }

    @Override
    public ChatGroup getChatGroupById(int id) {
        return chatGroupMapper.getChatGroupById(id);
    }

    @Override
    public List<ChatGroup> getAllChatGroups() {
        return chatGroupMapper.getAllChatGroups();
    }

    @Override
    public void addDoctorToChatGroup(int chatGroupId, int doctorId) {

    }

    @Override
    public void createNewChatGroup(List<Integer> doctorIds, String groupName) {
    }

    @Override
    public List<ChatGroup> queryChatGroupsByDoctorId(int doctorId) {
        return chatGroupMapper.getChatGroupsByUserId(doctorId);
    }
}